;; A minimal GNU Guix configuration with nonguix channel & substitute server.
(use-modules 
 (gnu)
 (gnu packages games)
 (gnu packages package-management)
 (gnu services base)
 (nongnu packages linux)
 (nongnu system linux-initrd))

(use-service-modules cups desktop networking ssh xorg)

(operating-system
 (kernel linux)
 (initrd microcode-initrd)
 (firmware 
  (list linux-firmware))
 (locale "en_US.utf8")
 (timezone "America/Los_Angeles")
 (keyboard-layout (keyboard-layout "us"))
 (host-name "emperor")

 (users 
  (cons* 
   (user-account
    (name "miaomiao")
    (comment "Miao Miao")
    (group "users")
    (home-directory "/home/miaomiao")
    (supplementary-groups  
     '("wheel" "netdev" "audio" "video" "lp" "input")))
   %base-user-accounts))

 (packages
  (append
   (list
    steam-devices-udev-rules)
  %base-packages))

 (services
  (append 
   (list 
    (service gnome-desktop-service-type)
    (service gnome-keyring-service-type)
    (service bluetooth-service-type
     (bluetooth-configuration
      (auto-enable? #t)))
    (udev-rules-service 'steam-udev
     steam-devices-udev-rules)
    ;; To configure OpenSSH, pass an 'openssh-configuration'
    ;; record as a second argument to 'service' below.
    (service openssh-service-type)
    (service cups-service-type)
    (set-xorg-configuration
     (xorg-configuration 
      (keyboard-layout keyboard-layout))))
    (modify-services %desktop-services
     ;; Get nonguix substitutes & public SSL authentication keys.
     (guix-service-type config =>
      (guix-configuration
       (inherit config)
       (substitute-urls
        (append
         (list "https://substitutes.nonguix.org")
        %default-substitute-urls))
       (authorized-keys
        (append
         (list
          (plain-file "non-guix.pub"
                      "(public-key 
                        (ecc 
                         (curve Ed25519)
                         (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)
                        )
                       )"))
        %default-authorized-guix-keys)))))))

 (bootloader 
  (bootloader-configuration
   (bootloader grub-efi-bootloader)
   (targets 
    (list "/boot/efi"))
   (keyboard-layout keyboard-layout)))

 (file-systems 
  (cons* 
   (file-system
    (mount-point "/")
    (device
     (uuid "75c35198-4df2-4ed1-a859-390070fa1812" 'btrfs))
    (type "btrfs"))
   (file-system
    (mount-point "/home")
    (device 
     (uuid "6589283c-d942-4e67-a545-d03838d44cae" 'btrfs))
    (type "btrfs"))
   (file-system
    (mount-point "/boot/efi")
    (device 
     (uuid "75E5-1CEF" 'fat32))
    (type "vfat")) 
  %base-file-systems))
 
 (swap-devices
  (list
   (swap-space
    (target
     (uuid "2bc3d195-4a99-450d-8766-5ea5e640736a"))))))
